package com.dykj.fireFighting.web.rocketmq.producer;

import com.dykj.fireFighting.web.model.haiman.HaiManGas;
import com.dykj.fireFighting.web.rocketmq.message.InsertDevHisGasMessage;
import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zhengbo
 */
@Component
public class InsertDevHisGasProducer {
    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    public void asyncSend(HaiManGas haiManGas, SendCallback callback) {
        InsertDevHisGasMessage insertDevHisGasMessage = new InsertDevHisGasMessage();
        insertDevHisGasMessage.setHaiManGas(haiManGas);
        rocketMQTemplate.asyncSend(InsertDevHisGasMessage.TOPIC, insertDevHisGasMessage, callback);
    }
}
